import React, { Component } from 'react'
import { HashRouter, Route, Switch } from 'react-router-dom'
import znCH from 'antd/lib/locale-provider/zh_CN'
import { LocaleProvider  } from 'antd'
import App from './App'
import Login from './pages/login'
import Home from './pages/home'
import NoMatch from './pages/noMatch'
import Culture from './pages/home/culture'
import Personal from './pages/home/personal'
import Team from './pages/home/team'
import Project from './pages/home/project'
import Link from './pages/home/link'
import User from './pages/home/user'
import PersonalWeekly from './pages/home/personal/personalWeekly'
import PersonalReward from './pages/home/culture/personalReward'
import PersonalInfor from './pages/home/culture/personalInfor'
import Modify from './pages/home/user/modify'

export default class Router extends Component {
  render() {
    return (
      <LocaleProvider locale={znCH}>
        <HashRouter>
          <App>
            <Switch>
              <Route exact path="/" component={ Login }></Route>
              <Route exact path="/login" component={ Login }></Route>
              <Route path="/home" render={ () => 
                <Home>
                  <Route exact path="/home" component={ Culture }></Route>
                  <Route path="/home/culture" component={ Culture }></Route>
                  <Route path="/home/personal" component={ Personal }></Route>
                  <Route path="/home/team" component={ Team }></Route>
                  <Route path="/home/project" component={ Project }></Route>
                  <Route path="/home/link" component={ Link }></Route>
                  <Route path="/home/user" component={ User }></Route>
                  <Route path="/home/personalWeekly" component={ PersonalWeekly }></Route>
                  <Route path="/home/personalReward" component={ PersonalReward }></Route>
                  <Route path="/home/personalInfor" component={ PersonalInfor }></Route>
                  <Route path="/home/modify" component={ Modify }></Route>
                  
                </Home>
              }></Route>
              <Route component={ NoMatch }></Route>
            </Switch>
          </App>
        </HashRouter>
      </LocaleProvider>
      
    )
  }
}
